package sctu.edu.java.year2016.team08.zengshenjing.day20160523.chapter6_2;

/**
 * Created by Administrator on 2016/5/23.
 */
public class chapter6_2 {
    public static void main(String[] args) {
        char a[]={'0',' ','2',' ','6',' ','5'};
        int c,f=0,i;
        String s1=new String(a);//创建原字符串
        c=s1.length();//计算原字符串的长度
        char b[]=new char [c];
        String s2=new String(b);//创建一个新的空字符串
        for(i=0;i<c;i++) {
            if (a[i] == ' ')
                i++;
            else
                b[f] = a[i];//将不是空格的元素存入空字符串b
            System.out.print(b[f]);
            f++;
            i++;

        }

    }
}